package com.zzyl.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzyl.entity.CheckInConfig;
import com.zzyl.entity.Room;
import com.zzyl.vo.RoomVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RoomMapper extends BaseMapper<Room> {

    List<RoomVo> findByFloorId(Long floorId);

    RoomVo findByIdRoom(Long id);

    @Select("select p.check_in_start_time,p.check_in_end_time\n" +
            "from base_room br\n" +
            "left join base_bed bb on br.id = bb.room_id\n" +
            "left join elder e on bb.id = e.bed_id\n" +
            "left join pro_check_in_config p on e.id = p.elder_id\n" +
            "where br.id = #{id} ")
    CheckInConfig findTime(Long id);
}
